//
//  HomeTableViewCell.swift
//  MySwift
//
//  Created by nadyboy on 2018/12/13.
//  Copyright © 2018年 hjh. All rights reserved.
//

import UIKit
class HomeTableViewCell: UITableViewCell {
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        addSubview(self.titleLabel)
        addSubview(self.imageV)
        addSubview(self.timeLabel)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var titleLabel: UILabel = {
        
        let label = UILabel()
        label.textAlignment = .left
        label.font = UIFont.systemFont(ofSize: 15)
        label.textColor = UIColor.red
        label.numberOfLines = 0
        return label
    }()
    
    lazy var imageV :UIImageView = {
       let imageV = UIImageView()
        imageV.image = UIImage(named: "11.jpg")
        imageV.backgroundColor = UIColor.red
        return imageV
    }()
    
    lazy var timeLabel: UILabel = {
        let label = UILabel()
        label.textColor = UIColor.lightGray
        label.font = UIFont.systemFont(ofSize: 12)
        label.text = "2018-10-14"
        return label
    }()
    
    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel.frame = CGRect(x: 10, y: 10, width: 100, height: 30)
        imageV.frame = CGRect(x: 10, y: titleLabel.frame.maxY+10, width: Constant.SCReenWidth - 20, height: 70)
        timeLabel.frame = CGRect(x: 10, y: imageV.frame.maxY + 10, width: 100, height: 20)
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
